package com.itheima.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.Alias;

/**
 * @ClassName Brand
 * @Description TODO
 * @Author Shinelon
 * @Date DATE 2021/6/22 15:05
 */

@Alias("Brand")
@TableName("tb_brand")
public class Brand {
    //自定义id生成策略
    @TableId(type = IdType.AUTO)
    private  Long id;
    private  String name;
    //如果不希望字段被查出
    @TableField(select = false)
    private  String image;
    //数据库字段名和驼峰名字不一致
    @TableField(value = "letter")
    private  String letter;
    //关联对象 但是数据库没有此字段
    @TableField(exist = false)
    private String Category;

    public Brand(){

    }
    public Brand(Long id, String name, String image, String letter) {
        this.id = id;
        this.name = name;
        this.image = image;
        this.letter = letter;
    }

    @Override
    public String toString() {
        return "Brand{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", image='" + image + '\'' +
                ", letter='" + letter + '\'' +
                ", Category='" + Category + '\'' +
                '}';
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getLetter() {
        return letter;
    }

    public void setLetter(String letter) {
        this.letter = letter;
    }

    public String getCategory() {
        return Category;
    }

    public void setCategory(String category) {
        Category = category;
    }
}
